﻿using UnityEngine;

namespace ZFramework.Runtime
{
    public sealed class WebRequestContentInfo : IReference
    {
        private string m_contentType;
        private object m_UserData;

        public WebRequestContentInfo()
        {
            m_contentType = null;
            m_UserData = null;
        }

        public string ContentType
        {
            get
            {
                return m_contentType;
            }
        }

        public object UserData
        {
            get
            {
                return m_UserData;
            }
        }

        public static WebRequestContentInfo Create(string contentType, object userData)
        {
            WebRequestContentInfo info = ReferencePool.Acquire<WebRequestContentInfo>();
            info.m_contentType = contentType;
            info.m_UserData = userData;
            return info;
        }

        public void Clear()
        {
            m_contentType = null;
            m_UserData = null;
        }
    }
}
